package model;

import common.Constant;

import util.KeyGen;
import util.ParameterCheck;

public class Item {
	public int id;
	public String name;
	public String name_py;
	public String name_py2;
	public boolean gender;
	public String birth;
	public String tags;
	public String ctime;
	public int hot;
	public String img;
	public int uid;
	public int matchdegree;
	public String MatchedTags;
	public String code;
	public int comment_count;
	
	
	
	public int getComment_count() {
		return comment_count;
	}
	public void setComment_count(int commentCount) {
		comment_count = commentCount;
	}
	public String getName_py2() {
		return name_py2;
	}
	public void setName_py2(String namePy2) {
		name_py2 = namePy2;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getMatchedTags() {
		return MatchedTags;
	}
	public void setMatchedTags(String matchedTags) {
		MatchedTags = matchedTags.trim();
	}
	public Item(int i, int j) {
		// TODO Auto-generated constructor stub
		super();
		setId(i);
		setMatchdegree(j);
	}
	public Item() {
		// TODO Auto-generated constructor stub
		super();
	}
	public int getMatchdegree() {
		return matchdegree;
	}
	public void setMatchdegree(int matchdegree) {
		this.matchdegree = matchdegree;
	}
	public int getUid() {
		return uid;
	}
	public void setUid(int uid) {
		this.uid = uid;
	}
	public String getImg() {
		return Constant.imgurl+img;
	}
	public void setImg(String img) {
		this.img = img;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
		this.setCode(KeyGen.convertId2Code(id));
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isGender() {
		return gender;
	}
	public void setGender(boolean gender) {
		this.gender = gender;
	}
	public String getBirth() {
		return birth;
	}
	public void setBirth(String birth) {
		this.birth = birth;
	}
	public String getTags() {
		return tags;
	}
	public void setTags(String tags) {
		this.tags = tags;
	}
	public String getCtime() {
		return ctime;
	}
	public void setCtime(String ctime) {
		this.ctime = ParameterCheck.getTimeFormat(ctime);
	}
	public int getHot() {
		return hot;
	}
	public void setHot(int hot) {
		this.hot = hot;
	}
	public String getName_py() {
		return name_py;
	}
	public void setName_py(String namePy) {
		name_py = namePy;
	}
	
	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		Item it=(Item)obj;
		if(this.getId()==it.getId())
			return true;
		return false;
		
	}
	
	
	
	
}
